<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>授权查询页面</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
    <style>
        body {
            background-color: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            padding: 0;
            background-image: url('https://api.mhimg.cn/api/acg/');
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center center;
        }
       .container {
            padding: 40px;
            border-radius: 10px;
            text-align: center;
            background: rgba(255, 255, 255, 0.5);
            backdrop-filter: blur(10px);
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            width: 40%; /* 修改容器宽度 */
            height: 40%; /* 修改容器高度 */
        }
       .header {
            margin-bottom: 30px;
        }
       .header h1 {
            color: #333;
            font-size: 28px;
        }
       .content {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
       .form-label {
            font-size: 14px;
        }
       .form-control {
            padding: 10px;
            font-size: 14px;
        }
       .btn {
            padding: 12px 24px;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>授权查询</h1>
        </div>
        <div class="content">
            <form class="form" action="">
                <div class="mb-3">
                    <label for="authStation" class="form-label">授权站</label>
                    <select name="authStation" id="authStation" class="form-select">
                        <option value="shouhucj.com/sq/">守护网络授权站</option>
                        <option value="as.wxcxu.cn">安生授权站</option>
                        <option value="sq.qxbot.top">囚心授权站</option>
                        <option value="auth.mhimg.cn">狗哥授权站</option>
                    </select>
                </div>
                <div class="mb-3">
                    <label for="qqInput" class="form-label">QQ 号</label>
                    <input type="text" name="qq" id="qqInput" class="form-control" placeholder="请输入 QQ 号" required>
                </div>
                <button type="button" class="btn btn-primary" onclick="queryAuth()">查询</button>
            </form>
        </div>
    </div>
    <script>
        function queryAuth() {
            var host = $("#authStation").val();
            var qq = $("#qqInput").val();
            $.ajax({
                url: "https://api.mhimg.cn/api/wenquan_auth",
                type: "GET",
                data: {
                    host: host,
                    qq: qq
                },
                success: function(response) {
                    var modal = $('<div class="modal fade" tabindex="-1" role="dialog">' +
                                '<div class="modal-dialog" role="document">' +
                                    '<div class="modal-content">' +
                                        '<div class="modal-header">' +
                                            '<h5 class="modal-title">查询结果</h5>' +
                                            '<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>' +
                                        '</div>' +
                                        '<div class="modal-body">' +
                                            '<p>' + response + '</p>' +
                                        '</div>' +
                                        '<div class="modal-footer">' +
                                            '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>' +
                                        '</div>' +
                                    '</div>' +
                                '</div>');
                    modal.modal('show');
                },
                error: function(xhr, status, error) {
                    var modal = $('<div class="modal fade" tabindex="-1" role="dialog">' +
                                '<div class="modal-dialog" role="document">' +
                                    '<div class="modal-content">' +
                                        '<div class="modal-header">' +
                                            '<h5 class="modal-title">错误</h5>' +
                                            '<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>' +
                                        '</div>' +
                                        '<div class="modal-body">' +
                                            '<p>查询失败：' + error + '</p>' +
                                        '</div>' +
                                        '<div class="modal-footer">' +
                                            '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>' +
                                        '</div>' +
                                    '</div>' +
                                '</div>');
                    modal.modal('show');
                }
            });
        }
    </script>
</body>
</html>